#include <iostream>
#include <set>
#include <vector>
#include <utility>

using std::cout;
using std::endl;
using std::set;
using std::vector;
using std::pair;

template <typename Container>
void display(const Container &con)
{
    for(auto &elem : con)
    {
        cout << elem << "  ";
    }
    cout << endl;
}

#if 0
template <typename T>
std::ostream &operator<<(std::ostream &os, const T& rhs)
{

}
#endif
class Point
{
public:
    Point(int ix = 0, int iy = 0)
    : _ix(ix)
    , _iy(iy)
    {

    }

    ~Point()
    {

    }

    friend std::ostream &operator<<(std::ostream &os, const Point &rhs);
private:
    int _ix;
    int _iy;
};

std::ostream &operator<<(std::ostream &os, const Point &rhs)
{
    os << "(" << rhs._ix
       <<", " << rhs._iy
       << ")";
    return os;
}

//命名空间是可以进行扩展的
namespace  std
{

template <>//模板的特化
struct less<Point>
{
    bool operator()(const Point &lhs, const Point &rhs) const
    {

    }

};

}//end of namespace std


bool operator<(const Point &lhs, const Point &rhs)
{

}

struct ComparePoint
{
    bool operator()(const Point &lhs, const Point &rhs) const
    {

    }
};

void test()
{
    set<Point> number = {
    /* set<Point, ComparePoint> number = { */
        Point(1, 2),
        Point(1, -2),
        Point(-1, 2),
        Point(1, 2),
        Point(11, 2),
        Point(1, 4),
        Point(3, 2),
    };
    display(number);
}

int main(int argc, char *argv[])
{
    test();
    return 0;
}

